package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售订单实体
 * */

@Data
@NoArgsConstructor
@ToString
@TableName("t_saleorder")
public class SaleOrderBean {
    @TableId(value = "pk_saleOrderId",type = IdType.AUTO)
    /**销售订单id*/
    private Integer id;
    @TableField("fk_clientId")
    /**客户id*/
    private Integer clientId;
    @TableField(exist = false)
    /**客户*/
    private ClientBean client;
    @TableField("fk_userId")
    /**用户id*/
    private Integer userId;
    @TableField(exist = false)
    /**用户*/
    private UserBean user;
    @TableField("so_createDate")
    /**销售时间*/
    private LocalDate createDate=LocalDate.now();
    @TableField("so_totalPrice")
    /**订单总额*/
    private Integer totalPrice;
    @TableField("so_address")
    /**送货地址*/
    private String address;
    @TableField(exist = false)
    /**销售订单详情集合*/
    private List<SaleOrderInfoBean> saleOrderInfoList;

    public SaleOrderBean(Integer clientId, Integer userId, Integer totalPrice, String address) {
        this.clientId = clientId;
        this.userId = userId;
        this.totalPrice = totalPrice;
        this.address = address;
    }
}
